package com.ruoyi.order.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.order.domain.MemberCardOrder;
import com.ruoyi.order.mapper.MemberCardOrderMapper;
import com.ruoyi.order.service.IMemberCardOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 会员卡订单Service业务层处理
 *
 * @author HHAOYU
 * @date 2021-01-04
 */
@Service
public class MemberCardOrderServiceImpl extends ServiceImpl<MemberCardOrderMapper, MemberCardOrder> implements IMemberCardOrderService {
    @Autowired
    private MemberCardOrderMapper memberCardOrderMapper;

    /**
     * 查询会员卡订单
     *
     * @param id 会员卡订单ID
     * @return 会员卡订单
     */
    @Override
    public MemberCardOrder selectMemberCardOrderById(Long id)
    {
        return memberCardOrderMapper.selectMemberCardOrderById(id);
    }

    /**
     * 查询会员卡订单列表
     *
     * @param memberCardOrder 会员卡订单
     * @return 会员卡订单
     */
    @Override
    public List<MemberCardOrder> selectMemberCardOrderList(MemberCardOrder memberCardOrder)
    {
        return memberCardOrderMapper.selectMemberCardOrderList(memberCardOrder);
    }

    /**
     * 新增会员卡订单
     *
     * @param memberCardOrder 会员卡订单
     * @return 结果
     */
    @Override
    public int insertMemberCardOrder(MemberCardOrder memberCardOrder)
    {
        memberCardOrder.setCreateTime(DateUtils.getNowDate());
        return memberCardOrderMapper.insertMemberCardOrder(memberCardOrder);
    }

    /**
     * 修改会员卡订单
     *
     * @param memberCardOrder 会员卡订单
     * @return 结果
     */
    @Override
    public int updateMemberCardOrder(MemberCardOrder memberCardOrder)
    {
        return memberCardOrderMapper.updateMemberCardOrder(memberCardOrder);
    }



    /**
     * 批量删除会员卡订单
     *
     * @param ids 需要删除的会员卡订单ID
     * @return 结果
     */
    @Override
    public int deleteMemberCardOrderByIds(Long[] ids)
    {
        return memberCardOrderMapper.deleteMemberCardOrderByIds(ids);
    }

    /**
     * 删除会员卡订单信息
     *
     * @param id 会员卡订单ID
     * @return 结果
     */
    @Override
    public int deleteMemberCardOrderById(Long id)
    {
        return memberCardOrderMapper.deleteMemberCardOrderById(id);
    }
}
